package com.loeng.framework.dict.config;

import com.loeng.framework.dict.core.DictFrameworkUtils;
import com.loeng.module.system.api.dict.DictDataApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class LoengDictAutoConfiguration {

    /**
     * 注入工具类的bean
     *  确保 DictDataApi 的实例能够被正确注入到工具类的静态字段中
     */
    @Bean
    @SuppressWarnings("InstantiationOfUtilityClass")
    public DictFrameworkUtils dictUtils(DictDataApi dictDataApi) {
        DictFrameworkUtils.init(dictDataApi);
        return new DictFrameworkUtils();
    }

}
